#include <stdio.h>  
#include <sys/types.h>  
#include <sys/stat.h>  
#include <fcntl.h>  

int main(int argc,char *argv[])  
{  
	int fd,len;  
	int adc;  
	fd = open("/dev/fsadc0",O_RDWR);
	if(fd == -1){  
		perror("open fail \n");  
		return -1;  
	}  

	while(1)  
	{  
		read(fd,&adc,4);  
		sleep(1);
		printf("adc value :%0.2fV.\n",(1.8*adc)/4096);  
	}  

	close(fd);  
}  